@echo off

set CURRENT_DIR=%cd%
set SCRIPT_DIR=%~d0%~p0

cd /d %SCRIPT_DIR%
cd ..
set PRJ_HOME=%cd%
cd %CURRENT_DIR%

@echo PROJECT_HOME = %PRJ_HOME%

set LOG_HOME=%PRJ_HOME%\logs
mkdir %LOG_HOME%

set CLASSPATH=.

rem Add jars to classpath
for %%F in (%PRJ_HOME%\lib\*.jar) do call :ADD_CP %%F

rem Run program
goto RUN

:ADD_CP
set CLASSPATH=%CLASSPATH%;%1
goto END

:RUN
@echo CLASSPATH = %CLASSPATH%
set JAVA_OPTS=%JAVA_OPTS% -Dlogging.home=%LOG_HOME% -Xmx512m -XX:+PrintCommandLineFlags
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:%LOG_HOME%\jvm-study.gc
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M
java -classpath %CLASSPATH% %JAVA_OPTS% cn.com.tiza.spiro.jvm.gc.optimization.Due2PermSizeFullGC
@echo END
goto END


:END